home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14302 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.magmacom.com!not-for-mail
  2. From: ezust@mag1.magmacom.com (Acme Instant Dehydrated Boulder Kit)
  3. Newsgroups: comp.lang.c++
  4. Subject: Is it OK to delete const *type pointers?
  5. Date: 29 Mar 1996 16:15:55 -0500
  6. Organization: Cloud-Zero, Canada
  7. Message-ID: <4jhjub$fpc@mag1.magmacom.com>
  8. NNTP-Posting-Host: mag1.magmacom.com
  9.  
  10.  
  11. Some compilers let me do this, others do not. What I would like to know is,
  12. what does Stroustrup think? I.e. is it written somewhere in the ARM (I checked
  13. but can't find it) or in the draft standard? If somoene could e-mail me a
  14. quote or a pointer to a place where I can read where it says such a thing
  15. should or should not be allowed, I would appreciate it!
  16.  
  17. const int* array= new int[30];
  18. delete[] array;
  19.  
  20. MSVC says "can not delete const*"
  21. Some versions of G++ also don't let me do this.
  22.  
  23. Is deleting an object technically considered changing that object's value?
  24.  
  25. -- 
  26. Alan Ezust                       "Just because I work for the federal
  27. Ottawa, Canada                    government doesn't mean I'm an expert
  28. ezust@magmacom.com                on cockroaches"  -Special Agent Fox Mulder
  29. http://www2.magmacom.com/~ezust   
  30.